import {lazy} from "react" //lazy懒加载
const routes = [
    {
        path:"/index",
        component:lazy(()=>import("../views/Index")),
        children:[
            {
                path:"/index/movie",
                component:lazy(()=>import("../views/Index/Movie"))
            },
            {
                path:"/index/found",
                component:lazy(()=>import("../views/Index/Found"))
            },
            {
                path:"/index/cinema",
                component:lazy(()=>import("../views/Index/Cinema"))
            },
            {
                path:"/index/my",
                component:lazy(()=>import("../views/Index/My"))
            },
            {
                path:"/index",
                redirect:"/index/movie"
            }
        ]
    },
    {
        path:"/detail",
        component:lazy(()=>import("../views/Detail"))
    },
    {
        path:"/",//当你的path是/  也计是默认为loaclhost:3000
        redirect:"/index"
    }
]

export default routes